//
//  LJP_FirstListTableViewCell.m
//  God_is_a_Girl
//
//  Created by 李继鹏 on 15/10/4.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LJP_FirstListTableViewCell.h"
#import "GuideModel.h"
#import <UIImageView+WebCache.h>

@implementation LJP_FirstListTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picture = [[UIImageView alloc] init];
        self.title = [[UILabel alloc] init];
        self.info = [[UILabel alloc] init];
        self.play = [[UILabel alloc] init];
        self.play.font = [UIFont systemFontOfSize:13];
        self.play.textColor = [UIColor colorWithWhite:0.545 alpha:1.000];
        self.info.font = [UIFont systemFontOfSize:15];
        self.picture.layer.cornerRadius = 5;
        self.picture.layer.masksToBounds = YES;
        [self.contentView addSubview:self.play];
        [self.contentView addSubview:self.title];
        [self.contentView addSubview:self.picture];
        [self.contentView addSubview:self.info];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.picture.frame = CGRectMake(10, 10, 80, 80);
    self.title.frame = CGRectMake(105, 10, [UIScreen mainScreen].bounds.size.width - 110, 25);
    self.info.frame = CGRectMake(105, 40, [UIScreen mainScreen].bounds.size.width - 110, 20);
    self.play.frame = CGRectMake(105, 70, [UIScreen mainScreen].bounds.size.width - 110, 15);
}
- (void)setModel:(GuideModel *)model
{
    if (model != _model) {
        _model = model;
    }
    [self.picture sd_setImageWithURL:[NSURL URLWithString:_model.coverMiddle] placeholderImage:[UIImage imageNamed:@"search"]];
    self.title.text = _model.title;
    self.info.text = _model.tags;
    self.play.text = [NSString stringWithFormat:@"播放:%@次   共:%@集", _model.playsCounts, _model.tracksCounts];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
